const {
	defineConfig
} = require('@vue/cli-service')
const path = require("path");
module.exports = defineConfig({
	devServer: {
		client: {
			overlay: false,
		},
		// proxy: {
		// 	'/api': {
		// 		target: 'https://www.ibmquantization.com', // 要访问的后端接口地址
		// 		changeOrigin: true, // 开启跨域
		// 		pathRewrite: {
		// 			'^/api': '' // 将请求地址中的 /api 前缀替换为空
		// 		}
		// 	}
		// },
	},

	chainWebpack: (config) => {
		// set svg-sprite-loader
		config.module
			.rule('svg')
			.exclude.add(path.resolve('src/svgIcon/svg'))
			.end();
		config.module
			.rule('icons')
			.test(/\.svg$/)
			.include.add(path.resolve('src/svgIcon/svg'))
			.end()
			.use('svg-sprite-loader')
			.loader('svg-sprite-loader')
			.options({
				symbolId: 'icon-[name]',
			})
			.end()
	},
	transpileDependencies: true,
	css: {
		loaderOptions: {
			less: {
				additionalData: `
        @import "@/assets/styles/common.less";
        @import "@/assets/styles/pctheme.less";
        `,
			},
		}
	}
})